from llm import NovelLLM
from util import writeFile
from .base import BaseNode

class Step4Node(BaseNode):
    def run(self, state):
        prompt = """
#Task
一页纸大纲
- 将五句话段落每句扩展为一段，
- 填充背景、冲突和转折细节

# 当前人物设定
{characters}

# 五句话段落
{summary}
        
        """.format(characters=state['step3_output'], summary=state['step2_output'])
        result = NovelLLM().call_llm(prompt, caller_name="Step4")
        state['step4_output'] = result
        writeFile("output/step4.txt", result)
        print(f"Step4 完成大纲扩展")
        return state